<?php

namespace Wgx\Admin\Com\Crud\ListPageSearchInput;

use Wgx\Admin\Com\Crud\ListPageSearchInputBase;

class InputCustomize extends ListPageSearchInputBase
{
    /** @var string */
    private $label;
    /** @var null|string */
    private $specParam;

    /**
     * InputCustomize constructor.
     * @param string $label
     * @param null|string $specParam - 额外指定的参数, 自定义用户输入控件的 dom
     */
    public function __construct($label, $specParam = null)
    {
        $this->label = $label;
        $this->specParam = $specParam;
    }

    /**
     * @inheritDoc
     */
    public function getLabel()
    {
        return $this->label;
    }

    /**
     * @param string $label
     * @return InputCustomize
     */
    public function setLabel($label)
    {
        $this->label = $label;
        return $this;
    }

    /**
     * @inheritDoc
     */
    public function getInputType()
    {
        return self::InputCustomize;
    }

    /**
     * @inheritDoc
     */
    public function getInitialValue()
    {
        return null;
    }

    /**
     * 额外指定的参数, 自定义用户输入控件的 dom
     * @return string|null
     */
    public function getSpecParam()
    {
        return $this->specParam;
    }

    /**
     * @param string|null $specParam - 额外指定的参数, 自定义用户输入控件的 dom
     * @return InputCustomize
     */
    public function setSpecParam($specParam)
    {
        $this->specParam = $specParam;
        return $this;
    }
}